home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cdropin1.arc / DOT.C < prev    next >
Text File  |  1985-10-02  |  896b  |  29 lines

  1. /* dot.c - dot graphics benchmark for Blaise Ctools package */
  2. ...
  3. #include "graph.h"
  4. ...
  5.  
  6.     if( mode == 6 )
  7.         grinit(2,0,0) ;        /* set mode */
  8.     else grinit(1,1,0) ;
  9.     timer() ;            /* start timer */
  10.     for(i=0 ; i<nit ; i++)
  11.       { for( j=0 ; j<nper ; j++ )
  12.           { pos.y = i & 0x3f ;    /* row = 0 - 15 */
  13.             pos.x = j & 0x7f ;    /* col = 0 - 63 */
  14.             grptwrit(& pos,color) ; /* write the dot */
  15.           }
  16.       }
  17.     t = timer() ;        /* collect elapsed time */
  18. ...
  19.     timer() ;            /* start timer */
  20.     for(i=0 ; i<nit ; i++)
  21.       { pos.y = i & 0x3f ;    /* row = 0 - 15 */
  22.         pos.x = (i+i) & 0x7f ;    /* col = 0 - 63 */
  23.         pos2.y = pos.y + nper ;    /* end point */
  24.         pos2.x = pos.x + nper ;
  25.         grline(&pos,&pos2,color) ; /* write a 45 degree line */
  26.       }
  27.     t = timer() ;        /* collect elapsed time */
  28. ...
  29.